﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Cdepartment.aspx.cs" Inherits="ZLDC.Estate.TM.Cdepartment" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>片区授权</title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../js/jquery/style/jquery.hiAlerts.css" rel="stylesheet" type="text/css" />

    <script src="../js/LexunJS.js" type="text/javascript"></script>

    <script src="../js/jShowDiv.js" type="text/javascript"></script>

    <script type="text/javascript">

        // 弹出授权片区层
        function addDialog() {
            var deptid = LexunJS.GetQueryString("tid");

            //            var width = 600;
            //            var height = 350;
            //            var iframe = "<iframe id=\"iframe_" + deptid + "\"  width=\"" + width + "\" height=\"" + (height - 30) + "\" frameborder=\"0\" scrolling=\"no\" src=\"CdepartmentAdd.aspx?typeid=" + typeid + "&deptid=" + deptid + "\" />";
            //            var title = "房号列表";
            //            var divId = "form1";

            //            dialog(iframe, title, width, height, divId);

            var path = "CdepartmentAdd.aspx?deptid=" + deptid;
            var parameter = "";
            var style = "dialogWidth:638px; dialogHeight:463px; status:0;scroll:1; help:0; resizable:1;Scrollbars=yes,Toolbar=no,Location=no,Direction=no,Resizeable=no";
            window.showModalDialog(path, parameter, style);
            location.reload();
        }

        // 弹出授权楼盘层
        function addDialog2() {
            var deptid = LexunJS.GetQueryString("tid");

            var path = "CdepartmentAdd2.aspx?deptid=" + deptid;
            var parameter = "";
            var style = "dialogWidth:638px; dialogHeight:463px; status:0;scroll:1; help:0; resizable:1;Scrollbars=yes,Toolbar=no,Location=no,Direction=no,Resizeable=no";
            window.showModalDialog(path, parameter, style);
            location.reload();
        }
        
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <table border="0" cellspacing="1" cellpadding="3" style="margin-top: 10px; width: 98%;
        text-align: center;" bgcolor="#a8c7ce">
        <tr>
            <td style="background-color: #FFFFFF; text-align: left;" colspan="3">
                当前操作部门:<asp:Label ForeColor="Red" Font-Bold="true" ID="ltlDeptName" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 60%; background-color: #353c44; color: White;" valign="top">
                <b>已授权的片区&nbsp; <a href='javascript:addDialog()'><font color='red'>添加</font></a></b>
            </td>
            <td style="width: 10%; background-color: #353c44; color: White;" valign="top">
                <b>业务范围</b>
            </td>
        </tr>
        <tr>
            <td style="background-color: #FFFFFF; vertical-align: top;">
                <table style="width: 100%">
                    <tr>
                        <td style="background-color: #FFFFFF; vertical-align: top;">
                            <asp:GridView ID="gvArea" runat="server" AutoGenerateColumns="False" PageSize="10"
                                AllowPaging="True" OnRowDeleting="gvArea_RowDeleting" OnRowDataBound="gvArea_RowDataBound"
                                Width="100%" OnPageIndexChanging="gvArea_PageIndexChanging">
                                <Columns>
                                    <asp:BoundField DataField="areaid" HeaderText="序号" />
                                    <asp:BoundField DataField="areaname" HeaderText="授权片区" />
                                    <asp:TemplateField HeaderText="可否查看电话">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsAreaTel" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="可否跟进">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsAreaFollow" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="可否修改盘信息">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsAreaInfo" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="可否查看客户电话">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsCusTel" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="可否跟进客户">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsCusFollow" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="删除 " ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                                Text="删除" OnClientClick="return confirm('你确定要删除吗？')"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <HeaderStyle BackColor="#F1FADE" />
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 50%; background-color: #353c44; color: White;" valign="top">
                            <b>已授权的楼盘&nbsp; <a href='javascript:addDialog2()'><font color='red'>添加</font></a></b>
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #FFFFFF; vertical-align: top;">
                            <asp:GridView ID="gvEstate" runat="server" AutoGenerateColumns="False" PageSize="10"
                                AllowPaging="True" OnRowDeleting="gvEstate_RowDeleting" OnRowDataBound="gvEstate_RowDataBound"
                                Width="100%" OnPageIndexChanging="gvEstate_PageIndexChanging">
                                <Columns>
                                    <asp:BoundField DataField="estateid" HeaderText="序号" />
                                    <asp:BoundField DataField="estateName" HeaderText="授权楼盘" />
                                    <asp:TemplateField HeaderText="可否查看电话">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsEstateTel" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="可否跟进">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsEstateFollow" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="可否修改盘信息">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbIsEstateInfo" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="删除 " ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                                Text="删除" OnClientClick="return confirm('你确定要删除吗？')"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <PagerStyle CssClass="STYLE1" />
                                <HeaderStyle BackColor="#F1FADE" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </td>
            <td style="background-color: #FFFFFF; vertical-align: top; text-align: left;">
                <asp:CheckBoxList ID="ListUsage" runat="server">
                </asp:CheckBoxList>
                <hr />
                <asp:CheckBox ID="cbxAreaCust" runat="server" Text="开放所有下级部门公客" Visible="false" />
            </td>
        </tr>
        <tr>
            <td colspan="2" style="background-color: #FFFFFF; vertical-align: top;">
                <asp:ImageButton ID="imgBtnOK" ImageUrl="../images/bot2.gif" runat="server" OnClick="imgBtnOK_Click" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
